﻿<%@ Page Title="" Language="VB" MasterPageFile="~/KYC/MasterPageKYC.master" AutoEventWireup="false" CodeFile="checkTotalRisk.aspx.vb" Inherits="KYC_checkIndividualSearch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
  
    $(document).ready(function () {
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        $("input[id$=btnAdd]").click(function () {
            window.open('IndividualCDD.aspx?uniqueID=' + $("input[id$=txtNo]").val()
                + '&FirstNameTH=' + $("input[id$=txtFirstNameTH]").val()
                + '&MidNameTH=' + $("input[id$=txtMidNameTH]").val()
                + '&LastNameTH=' + $("input[id$=txtLastNameTH]").val()
                + '&FirstNameEN=' + $("input[id$=txtFirstNameEN]").val()
                + '&MidNameEN=' + $("input[id$=txtMidNameEN]").val()
                + '&LastNameEN=' + $("input[id$=txtLastNameEN]").val()
                + '&TypeKYC=1'
                , '_self');
        });

        $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
            yearAddToDisplay: 543,
            dateFormat: 'dd/mm/yy',
            showOn: "button",
            buttonImage: "../img/calendar.gif",
            buttonImageOnly: true
        }));
        $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
            yearAddToDisplay: 543,
            dateFormat: 'dd/mm/yy',
            showOn: "button",
            buttonImage: "../img/calendar.gif",
            buttonImageOnly: true
        }));



        function EndRequestHandler(sender, args) {
            $("input[id$=btnAdd]").click(function () {
                window.open('IndividualCDD.aspx?uniqueID=' + $("input[id$=txtNo]").val()
                + '&FirstNameTH=' + $("input[id$=txtFirstNameTH]").val()
                + '&MidNameTH=' + $("input[id$=txtMidNameTH]").val()
                + '&LastNameTH=' + $("input[id$=txtLastNameTH]").val()
                + '&FirstNameEN=' + $("input[id$=txtFirstNameEN]").val()
                + '&MidNameEN=' + $("input[id$=txtMidNameEN]").val()
                + '&LastNameEN=' + $("input[id$=txtLastNameEN]").val()
                + '&TypeKYC=1'
                , '_self');
            });

            $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                yearAddToDisplay: 543,
                dateFormat: 'dd/mm/yy',
                showOn: "button",
                buttonImage: "../img/calendar.gif",
                buttonImageOnly: true
            }));
            $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                yearAddToDisplay: 543,
                dateFormat: 'dd/mm/yy',
                showOn: "button",
                buttonImage: "../img/calendar.gif",
                buttonImageOnly: true
            }));
        }
    });

    var hasSubmitted = 0;
    function NoDoubleSubmit() {
        var divMsg = document.getElementById('Processing');
        if (hasSubmitted == 0) {
            hasSubmitted = 0;
            divMsg.style.display = 'block';
            return true;
        }
        return false;
    }

   </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
          <table style="width:100%;">
            <tr>
                <td align="right"  >
                    <asp:Label ID="lblDept" runat="server"></asp:Label>
                </td>
                <td style="text-align: left">
                    <asp:DropDownList ID="ddlDepartment" runat="server" AutoPostBack="True" 
                        CssClass="control" Height="25px" Width="196px">
                    </asp:DropDownList>
                </td>
                <td style="text-align: right;" colspan="2">
                    <asp:Label ID="lblBranch" runat="server"></asp:Label>
                </td>
                <td style="text-align: left">
                    <asp:DropDownList ID="ddlBranch" runat="server" CssClass="control" 
                        Height="25px" Width="183px">
                    </asp:DropDownList>
                </td>
              
                <td style="text-align: left">
                    <asp:Label ID="Label2" runat="server" Width="239px"></asp:Label>
                </td>
              
            </tr>
            <tr>
                <td align="right"  > 
                </td>
                <td style="text-align: left">
                    &nbsp;</td>
                <td style="text-align: right;" colspan="2">
                  
                </td>
                <td style="text-align: left" >
                
                </td>
               
                <td style="text-align: left">
                    &nbsp;</td>
               
            </tr>
        
            <tr>
                <td colspan="6" style="text-align: right;">
                     <asp:Button ID="btnSearch" runat="server" CssClass="control" Text="ค้นหา" 
                         Width="135px" />
                     <asp:Button ID="btnKYC" runat="server" CssClass="control" 
                         Text="พิมพ์รายงาน" Width="135px" />
                </td>

            </tr>
            <tr>
                <td colspan="6" style="text-align: center" >
                <asp:Label ID="lblMsg" runat="server" ForeColor="Red" Text="ไม่พบข้อมูล" 
                        Font-Bold="True" Font-Size="30px" Height="30px" Visible="False"></asp:Label>

                <SPAN id="Processing" style="DISPLAY: none">
                    <img src="../img/icon/ajax-loader.gif" alt="Please wait" />
                        กรุณารอสักครู่ ระบบกำลังค้นหาข้อมูล...</SPAN>
                    <asp:GridView ID="grdIndividual" runat="server" CellPadding="4" 
                        ForeColor="#333333" AutoGenerateColumns="False" Width="100%" 
                        AllowPaging="True">
                        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                        <Columns>
                            <asp:TemplateField HeaderText="รหัสสาขา">
                                <ItemTemplate>
                                    <asp:Label ID="lblCustCode" runat="server" 
                                        
                                        Text='<%# iif(Eval("TRANTYPE")=2,"ลูกค้าขาจร",iif(Eval("TRANTYPE")=3,"ผู้จัดการกองทุน",iif(Eval("TRANTYPE")=4,"ผู้ถือหุ้น",(Eval("CUSTCODE"))))) %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Width="10%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="ชื่อสาขา">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                 <asp:Label ID="lblTHName" runat="server" 
                                      
                                     Text='<%# Eval("THFIRSTNAME") & "  " & Eval("THMIDNAME") & "  " & Eval("THLASTNAME") %>'></asp:Label>
                                 </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" Width="18%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="ความเสี่ยง 1">
                            <ItemTemplate>
                                 <asp:Label ID="Label1" runat="server" 
                                      
                                     Text='<%# eval("AMLCDD") & " / " & eval("ETL_STATUS") %>'></asp:Label>
                                 </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="ความเสี่ยง 2" DataField="DEPD" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle Width="5px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="ความเสี่ยง 3" DataField="DEPL" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle Width="5px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="ยังไม่เประเมิน" DataField="DEPP" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle Width="5px" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="รวมทั้งสิ้น">
                                <ItemTemplate>
                                    <asp:Label ID="lblUpdateDate" runat="server" 
                                        Text='<%# Eval("UPDATEDATE") %>'></asp:Label>
                                    <asp:Label ID="lblDepUpdate" runat="server" 
                                        Text='<%# "(" & Eval("DEPUPDATE") & ")" %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" 
                    CssClass="cssPager" />
                        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                        <HeaderStyle BackColor="#FF9933" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                </td>
               
            </tr>
        </table>
          <div align="right">
            <asp:Label ID="lblTotal" runat="server" Font-Bold="True" ForeColor="#003300"></asp:Label>
          </div>
            
    </ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

